import os

file = input("输入文件名: ")

try:
    os.remove(file)
    print(f"{file} 已删除")
except FileNotFoundError:
    print(f"文件不存在: {file}")
except PermissionError:
    print(f"无权限删除: {file}")
except Exception as e:
    print(f"错误: {e}")